{extend name="$_admin_base_layout" /}
{block name="content"}
<!-- Page Content -->
<div class="row">
    <div class="col-md-12">
        <div class="block">
            <div class="block-header bg-gray-lighter">
                <ul class="block-options">
                    <li>
                        <button type="button" data-toggle="block-option" data-action="refresh_toggle"
                                data-action-mode="demo"><i class="si si-refresh"></i></button>
                    </li>
                    <li>
                        <button type="button" data-toggle="block-option" data-action="fullscreen_toggle"><i
                                class="si si-size-fullscreen"></i></button>
                    </li>
                </ul>
                <h3 class="block-title">店铺账务明细</h3>
            </div>

            <div class="block-content tab-content">
                <div class="tab-pane active">

                    <div class="row data-table-toolbar">
                        <div class="col-sm-12">
                            <div class="toolbar-btn-action">
                            </div>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <div class="form-inline time-filter">
                            <form action="" class="time-filter" method="post">
                                <div class="input-daterange input-group" data-date-format="yyyy-mm-dd">
                                    <input class="form-control" type="text" name="startDate" value="" placeholder="开始日期">
                                    <span class="input-group-addon"><i class="fa fa-chevron-right"></i></span>
                                    <input class="form-control" type="text" name="endDate" value="" placeholder="结束日期">
                                </div>
                                <button type="submit" class="btn btn-default">确定</button>
                            </form>
                        </div>
                        <table class="table table-builder table-hover table-bordered table-striped js-table-checkable "
                               style="table-layout:fixed;">
                            <thead>
                            <tr>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">
                                    单据号
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    客户名称
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    账户类型
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    单据类型
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    期初金额
                                </th>
                                <th class="" colspan="2" rowspan="1" style="text-align: center;vertical-align: middle">

                                    应付账款
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    期末余额
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    创建时间
                                </th>
                                <th class="" colspan="1" rowspan="2" style="text-align: center;vertical-align: middle;font-size: 17px;">

                                    操作
                                </th>
                            </tr>
                            <tr>
                                <th style="text-align: center;vertical-align: middle">增加</th>
                                <th style="text-align: center;vertical-align: middle">减少</th>
                            </tr>
                            </thead>
                            <tbody>
                            {foreach name="account" item="v"}
                            <tr>

                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.no}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.shop_name}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$type[$v['account_type']]}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$order_type[$v['type']]}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.balance|getPrice}
                                </td>
                                {if condition="$v.num gt 0"}
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.num|getPrice}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    0
                                </td>
                                {else/}
                                <td class="" style="text-align: center;vertical-align: middle">
                                    0
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.num|getPrice}
                                </td>
                                {/if}
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v['num']+$v['balance']|getPrice}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    {$v.createtime|date='Y-m-d H:i:s',###}
                                </td>
                                <td class="" style="text-align: center;vertical-align: middle">
                                    <div class="btn-group"><a style="margin-right:8px;" title="" icon="fa fa-wrench"
                                                              class="btn btn-xs btn-default"
                                                              href="/admin.php/capital/membercapital/edit/id/7.html"
                                                              target="_self" data-toggle="tooltip"
                                                              data-original-title="作废"><i class="fa fa-wrench"></i></a>
                                    </div>
                                </td>
                            </tr>
                            {/foreach}
                            </tbody>
                        </table>
                    </div>
                    <div class="data-table-toolbar">
                        <div class="row">
                            <div class="col-sm-12">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script src="/public/static/libs/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        App.initHelpers(["datepicker"]);
    })
</script>
{/block}
